@extends('layouts.console_header')

@section('title', '审核详情')

@section('resources')
    @parent
    <link rel="stylesheet" href="https://cache.amap.com/lbs/static/main1119.css"/>
    <style>
        .revise_phonenum{width: 80px;height: 20px;border: 1px solid #818181;margin-left: 30px;border-radius: 5px;text-align: center;cursor: pointer;}
        .phone_num{width: 400px;position: fixed;;top: 200px;left: 50%;margin-left: -200px;background-color: #fff;border: 1px solid #000;display: none;}
        .phone_num p{padding: 10px;}
        .close{width: 20px;height: 20px;}
        #old_phonenum,#new_phonenum{width: 150px;height: 30px;border: 1px solid #000;padding: 0 5px;}
        #phoneclose{width: 100px;height: 30px;background-color: #ccc;margin-left: 30px;text-align: center;line-height: 30px;}
        #phonesure{width: 100px;height: 30px;background-color: #9955c6;color: #fff;margin-left: 130px;}
        .big_picture{width: 1200px;position: fixed;top: 0;left: 50%;margin-left: -600px;background: rgba(0,0,0,0.5);z-index: 1000;display: none;}
        .big_picture .big_pictureurl{position: absolute;top: 50%;left: 50%;}
        .big_picture .big_pictureclose{position: absolute;top: 0;right: 0;}
        #container{width: 440px;height: 230px;position: relative;margin-top: 15px;}
        .amap-zoom-ruler{height: 60px;}
        .amap-zoom-label-street{top: -20px;}
        .amap-zoom-label-city{top: 5px;}
        .amap-zoom-label-province{top: 30px;}
        .amap-zoom-label-country{top: 55px;}
        .shop_servicing_check{cursor: pointer;margin-right: 20px;}
        .shop_details_outer_top_check{overflow: hidden;  display: none;padding: 20px 0;}
        .shop_details_outer_top_check select{width: 200px;height: 28px;border: 1px solid #000;}
        .shop_details_outer_top_check .shop_servicing_cancel{margin: 4px 0px 4px 20px;cursor: pointer; }
        .shop_details_outer_top_check .shop_servicing_sure{margin: 4px 0px 4px 20px;cursor: pointer; }
    </style>
@endsection

@section('content')
<!--  html内容  -->
<section class="user_list">
    <p class="big_picture">
        <img class="big_pictureclose" src="{{env('IMAGE_DOMAIN')}}images/access_delete.png" alt="">
        <img class="big_pictureurl" src="" alt="">
    </p>
	<div style="border-bottom: 2px solid #9955c6;overflow: hidden;">
		<p class="fz_14 account_title fl" style="border: none;">
		    <span style="color: #7f7f7f;">
		        <a href="/console/index">首页></a>
		        商家版运营>
            @if($adminrole == 'customer')
                <a href="/console/shop/custom/waitlist?cityid={{$cityid}}">待审核商家列表></a>
                </span>
                <span class="co_violet">审核</span>
            @else
		        <a href="/console/shop/waitlist?cityid={{$cityid}}">审核不通过列表></a>
		        </span>
		        <span class="co_violet">编辑</span>
            @endif
        </p>
		<a onclick="history.go(-1);" href="#"><p class="fr tc back_btn">返回</p></a>
	</div>
	<div class="shop_details_outer">
		<p class="shop_details_outer_top fz_16 oh">
			<span class="fl">商务人员</span>
			<span class="fl" style="margin-left: 30px;">开拓人：</span>
			<span class="fl">{{$contractorname}}  {{$contractormobile}}</span>
			<span class="fl" style="margin-left: 100px;">维护人：</span>
			<span class="fl">{{$maintainername}}  {{$maintainermobile}}</span>
            @if(isset($businessPersonnel) && !empty($businessPersonnel))
                @if($businessPersonnel['roletype'] == 2)
                    <span class="fr co_violet shop_servicing_check">修改</span>
                @else
                    <input type="hidden" name="adminroleid" value="{{$maintainerid}}" id="adminroleid">
                @endif
            @endif
		</p>
        @if(isset($businessPersonnel) && !empty($businessPersonnel))
            @if($businessPersonnel['roletype'] == 2)
		<p class="shop_details_outer_top_check fz_16 oh">
			<span class="fl">维护人：</span>
            <select class="fl" name="" id="roleinfo">
                <option value="">请选择</option>
                @foreach($businessPersonnel['roleinfo'] as $list)
                    <option value="{{$list['adminid']}}"  <?php echo $list['adminid'] ==$maintainerid?'selected="selected"':''; ?>>{{$list['realname']}} {{$list['mobile']}}</option>
                @endforeach
            </select>
            <input type="hidden" name="adminroleid" value="{{$maintainerid}}" id="adminroleid">
            <span class="fl shop_servicing_cancel">取消</span>
            <span class="fl co_violet shop_servicing_sure" id="updatemaintenance">确定</span>
		</p>
            @endif
        @endif
		<ul>
			<li>
				<div class="oh shop_details_outer_title">
					<h2 class="fl">基本信息</h2>
					<a class="fr co_violet" href="/console/shop/review/check?shopreviewid={{$id}}&cityid={{$cityid}}&adminrole={{$adminrole}}&type=basic">修改</a>
				</div>
                <div class="oh">
                    <div class="fl">
                        <h3>{{$name}}</h3>
                        <p>
                            <span>商家代码：</span>
                            <span>{{$code}}</span>
                        </p>
                        <p>
                            <span>分类：</span>
                            <span>{{$firstclassname}}-{{$secondclassname}}</span>
                        </p>
                        <p>
                            <span>标签：</span>
                            <span>{{$label}}</span>
                        </p>
                        <p>
                            <span>前台电话：</span>
                            <span>{{$contactnumber}}</span>
                        </p>
                        <p>
                            <span>接收短信手机号码：</span>
                            <span>{{$smsphone}}</span>
                        </p>
                        <p>
                            <span>营业时间：</span>
                            <span>{{$businesshours}}</span>
                        </p>
                        <p>
                            <span>所在地：</span>
                            <span>{{$provincename . $cityname . $districtname . $businessareaname}}</span>
                        </p>
                        <p>
                            <span>地址：</span>
                            <span>{{$address}}</span>
                        </p>
                        <p>
                            <span>商家简介：</span>
                            <span>{{$description}}</span>
                        </p>
                    </div>
                    <div class="fr" id="container"></div>
                </div>
			</li>
			<li>
				<div class="oh shop_details_outer_title">
					<h2 class="fl">商家相册</h2>
					<a class="fr co_violet" href="/console/shop/review/check?shopreviewid={{$id}}&cityid={{$cityid}}&adminrole={{$adminrole}}&type=photo">修改</a>
				</div>
				<h3>商家主图</h3>
				<div class="business_picture oh">
                    <p>
                        <img src="{{env('IMAGE_DOMAIN')}}{{$logo}}?x-oss-process=image/resize,m_fill,h_160,w_230/auto-orient,0" alt="">
                    </p>
                </div>
				<h3>环境图</h3>
				<div class="business_picture oh">
                    @if(count($photos) >= 1)
                        @foreach($photos as $photo)
                            <p>
                                <img src="{{env('IMAGE_DOMAIN')}}{{$photo}}?x-oss-process=image/resize,m_fill,h_160,w_230/auto-orient,0" alt="">
                            </p>
                        @endforeach
                    @endif
				</div>
				<h3>产品图</h3>
				<ol class="goods_picture">
				@if(count($goodsphotos) >= 1)
                    @foreach($goodsphotos as $list)
                        <li class="oh">
                            <img class="fl" src="{{env('IMAGE_DOMAIN')}}{{$list['url']}}?x-oss-process=image/resize,m_fill,h_160,w_230/auto-orient,0" alt="">
                            <div class="fl">
                                <p>{{$list['name']}}</p>
                                <p>{{$list['description']}}</p>
                            </div>
                        </li>
				    @endforeach
				@endif
				</ol>
			</li>
			<li>
				<div class="oh shop_details_outer_title">
					<h2 class="fl">翻倍日</h2>
					<a class="fr co_violet" href="/console/shop/review/check?shopreviewid={{$id}}&cityid={{$cityid}}&adminrole={{$adminrole}}&type=doublecalendar">修改</a>
				</div>
				<p>每周最多{{$weekdoubleday}}个翻倍日</p>
				<p style="width: 1150px;">{{$event}}</p>
                {{--<p style="margin-top:20px;">翻倍日备注:&nbsp;&nbsp;&nbsp;&nbsp;{{$eventremark}}</p>--}}
			</li>
			<li>
				<div class="oh shop_details_outer_title">
					<h2 class="fl">收款账号</h2>
                @if($adminrole == 'customer')
					<a class="fr co_violet" href="/console/shop/review/check?shopreviewid={{$id}}&cityid={{$cityid}}&adminrole={{$adminrole}}&type=payaccount">修改</a>
				@endif
				</div>
				<p>持卡人： {{$cardholder}}</p>
				<p>身份证号：{{$idcard}}</p>
                <p>银行卡号：{{$bankcard}}</p>
				<p>银行：{{$bankname}}</p>
				<p>开户行：{{$bankprovince.$bankcity.$opencardbank}}</p>
			</li>
			<li>
				<div class="oh shop_details_outer_title">
					<h2 class="fl">法人/门店负责人信息</h2>
					<a class="fr co_violet" href="/console/shop/review/check?shopreviewid={{$id}}&cityid={{$cityid}}&adminrole={{$adminrole}}&type=legalperson">修改</a>
				</div>
				<p>负责人姓名：{{$parentname}} </p>
				<p style="overflow: hidden;"><span class="fl">商家登录帐号：{{$parentmobile}}</span><span class="revise_phonenum fl">修改手机号</span></p>
				<p>合约开始时间：{{$contractstarttime}}</p>
				<p>合约截止时间：{{$contractendtime}}</p>
			</li>
			<li>
				<div class="oh shop_details_outer_title">
					<h2 class="fl">代付规则</h2>
					<a class="fr co_violet" href="/console/shop/review/check?shopreviewid={{$id}}&cityid={{$cityid}}&adminrole={{$adminrole}}&type=payrules">修改</a>
				</div>
				<h3>代付范围</h3>
                @if(($notpartakegoods == '') ||($notpartakegoods == '无'))
                   <p> 全场参与，
                @else
                    <p>全场参与，除{{$notpartakegoods}}外，
                @endif
                @if($maxsales == 0)
                
                @else
                    {{$maxsales}}元封顶，
                @endif
                @if($buynumber == 0)
                    当天每个用户不限买单次数</p>
                @else
                    当天一个用户仅限{{$buynumber}}单</p>
                @endif

				<h3>发票</h3>
				<p>{{$invoice}}</p>
				<h3>其他</h3>
				<p>{{$content}}</p>
				<h3>温馨提示</h3>
				<p>为避免商品价格不实，翻贝网平台不显示商家价格，以用户和实体店最终议价为准，最后通过翻贝网代付。翻贝网热线：400-6989-820</p>
			</li>
			<li>
				<div class="oh shop_details_outer_title">
					<h2 class="fl">经营资质</h2>
					<a class="fr co_violet" href="/console/shop/review/check?shopreviewid={{$id}}&cityid={{$cityid}}&adminrole={{$adminrole}}&type=qualification">修改</a>
				</div>
				<ol class="shop_picture">
                    <li>
                        <p>银行卡正面照</p>
                        <img src="{{env('IMAGE_DOMAIN')}}{{$bankcardphoto}}?x-oss-process=image/resize,m_fill,h_160,w_230/auto-orient,0" alt="">
                    </li>
					<li>
						<p>营业执照</p>
						<img src="{{env('IMAGE_DOMAIN')}}{{$licensephoto}}?x-oss-process=image/resize,m_fill,h_160,w_230/auto-orient,0" alt="">
					</li>
					<li>
						<p>身份证正面照</p>
						<img src="{{env('IMAGE_DOMAIN')}}{{$idcardfrontphoto}}?x-oss-process=image/resize,m_fill,h_160,w_230/auto-orient,0" alt="">
					</li>
					<li>
						<p>身份证反面照</p>
						<img src="{{env('IMAGE_DOMAIN')}}{{$idcardbackphoto}}?x-oss-process=image/resize,m_fill,h_160,w_230/auto-orient,0" alt="">
					</li>
				</ol>
			</li>
		</ul>
	</div>
	@if($adminrole == 'businesspeople')
        <div style="margin: 10px;">
            <form action="" method="" id="" >
                <input type="hidden" name="cityid" value="{{$cityid}}" />
                <ul>
                <li>
                    <ol class="business_record">
                        <li style="width: 100%;">
                            <!-- <p style="color: #000;font-size: 18px;width: 100%;">初审操作</p> -->
                            <input type="hidden" name="shopreviewid" value="{{$id}}">
                            <div style="margin-top: 20px;">
                                {{--<span class="fz_16 co_gray56">审核结果</span>--}}
                                @if($lastverifynote)
                                    <span class="fz_16">{{date("Y-m-d",strtotime($lastverifytime))}} 客服审核不通过，理由:{{$lastverifynote}}</span>
                                @endif
                                <select hidden style="border: 1px solid  #808080;width: 100px;height: 25px;margin-left: 39px;" name="verifyresult" id="verifyresult" onchange="selectverifyresult(this)">
                                    {{--<option value="">请选择</option>--}}
                                    <option value="1" selected>初审通过</option>
                                    {{--<option value="0">初审不通过</option>--}}
                                </select>
                            </div>
                            <div style="margin-top: 20px;" hidden="hidden">
                                <span style="position: relative;top: -50px;margin-right: 39px;" class="fz_16 co_gray56">审核备注</span>
                                <textarea style="width: 900px;height: 50px;border: 1px solid #808080;padding: 5px 10px;" name="verifynote" id="" cols="30" rows="10">审核通过</textarea>
                            </div>
                        </li>
                    </ol>
                </li>
                </ul>
                <input type="button" style="background-color: #9955c6;width: 100px;height: 40px;border-radius: 5px;color: #fff;margin-top: 10px;" id="submitshopreview" value="提交审核">
                {{--<input type="button" style="background-color: #eee;width: 100px;height: 40px;border-radius: 5px;margin-left: 800px;" id="cancel" id="cancel" value="取消">--}}
            </form>
        </div>
	@elseif($adminrole == 'customer')
	    <div style="margin: 10px;">
            <form action="" method="" >
                <input type="hidden" name="cityid" value="{{$cityid}}" />
                <ul>
                <li>
                    <div class="oh shop_details_outer_title">
                        <h2>终审操作</h2>
                    </div>
                    <ol class="business_record">
                        {{--<li style="width: 100%;">--}}
                            {{--<p style="color: #000;font-size: 18px;width: 100%;">初级操作</p>--}}
                            {{--<p style="margin: 20px 0" class="oh"><span class="fl" style="margin-right: 100px;width: 400px;">初审人：{{$firstverifyname}} {{$firstverifymobile}}</span><span class="fl">审核时间：{{date('Y-m-d H:i:s', strtotime($firstverifytime))}}</span><p>--}}
                            {{--<p style="margin: 20px 0" class="oh"><span class="fl" style="margin-right: 100px;width: 400px;">审核优先级：紧急</span><span class="fl">初审状态：通过</span></p>--}}
                            {{--<p style="margin: 20px 0">审核备注：{{$firstverifynote}}</p>--}}
                        {{--</li>--}}
                        <li style="width: 100%;">
                            {{--<p style="color: #000;font-size: 24px;width: 100%;">终极操作</p>--}}
                            <input type="hidden" name="shopreviewid" value="{{$id}}">
                            <div style="margin-top: 10px;">
                                <span class="fz_16 co_gray56">审核结果</span>
                                <select style="border: 1px solid  #808080;height: 25px;margin-left: 39px;" name="verifyresult" id="verifyresult" onchange="selectverifyresult(this)">
                                    <option value="">请选择</option>
                                    <option value="1">终审通过-上架</option>
                                    <option value="0">终审不通过</option>
                                </select>
                            </div>
                            <div style="margin-top: 10px;display: none;" id="shop_level">
                                <span class="fz_16 co_gray56">商家级别</span>
                                <select style="border: 1px solid  #808080;height: 25px;margin-left: 39px;" name="shop_level_select" id="shop_level_select">
                                    <option value="0">请选择</option>
                                    <option value="A级">A级</option>
                                    <option value="B级">B级</option>
                                    <option value="C级">C级</option>
                                    <option value="D级">D级</option>
                                </select>
                                <input type="hidden" name="grade" value="">
                            </div>
                            <div style="margin-top: 10px;">
                                <span style="position: relative;top: -50px;margin-right: 39px;" class="fz_16 co_gray56">审核备注</span>
                                <textarea style="width: 900px;height: 50px;border: 1px solid #808080;padding: 5px 10px;" name="verifynote" id="" cols="30" rows="10"></textarea>
                            </div>
                        </li>
                    </ol>
                </li>
                </ul>
                <input type="button" style="background-color: #9955c6;width: 100px;height: 40px;border-radius: 5px;color: #fff;margin-top: 10px;" id="submitshopreview" value="提交">
                <input type="button" style="background-color: #eee;width: 100px;height: 40px;border-radius: 5px;margin-left: 800px;" id="cancel" id="cancel" value="取消">
            </form>
        </div>
	@endif
    <form action="" method="post" class="phone_num">
        <p class="oh phone_num_title">
            <span class="fl">修改法人手机号</span>
            <img class="fr close" src="{{env('IMAGE_DOMAIN')}}images/close_p.png" alt="">
        </p>
        <p class="oh ">
            <span class="fl">原法人手机号：</span>
            <input type="text" name="oldparentmobile" id="old_phonenum" value="" maxlength="11" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
            <span class="phone_num_oldparentmobile" style="font-size: 14px;color: red;margin: 0;display: none;">请输入11位数字</span>
        </p>
        <p class="oh ">
            <span class="fl">新法人手机号：</span>
            <input type="text" name="newparentmobile" value="" id="new_phonenum" maxlength="11" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
            <span class="phone_num_newparentmobile" style="font-size: 14px;color: red;margin: 0;display: none;">请输入11位数字</span>
        </p>
        <p id="phone_message"></p>
        <p class="button oh">
            <input class="fl" type="button" id="phonesure" name="" value="确定">
            <span id="phoneclose" class="fl">取消</span>
        </p>
    </form>
</section>
@endsection

@section('scriptResources')
    @parent
    <!-- js 文件-->
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.3&key=a9fe1b184bacd00ecd70365903024419&plugin=AMap.Autocomplete"></script>
    <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
    <script>
        var bodytop;
        var wh = $(window).height();
        var dh = $(document).height();
        var adminrole = '{{$adminrole}}';
        var cityid = '{{$cityid}}';
        var shopreviewid='{{$id}}';
        var mylongtitude='{{$longitude}}';
        var mylatitude='{{$latitude}}';
        //地图
        var marker,map = new AMap.Map("container", {
            resizeEnable: true,
            center: [mylongtitude, mylatitude],
            zoom: 13
        });
        function addMarker() {
            marker = new AMap.Marker({
                icon: "http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
                position: [mylongtitude, mylatitude]
            });
            marker.setMap(map);
        }
        addMarker()

        $(".shop_details_outer img").on("click",function(){       //大图模式
            bodytop = $("body").scrollTop();
            $(".big_picture").show();
            $(".big_picture").height($(window).height());
            var currenturl = $(this).attr("src");
            var currenturlarr = currenturl.split('?');
            $(".big_pictureurl").attr("src",currenturlarr[0]);
            setTimeout(function(){
                if($(".big_pictureurl").height() < $(".big_pictureurl").width()){
                    $(".big_pictureurl").css({"height":"auto","width":"90%"});
                    var pich = $(".big_pictureurl").height();
                    var picw = $(".big_pictureurl").width();
                    $(".big_pictureurl").css({"margin-top": -pich/2,"margin-left": -picw/2});
                }else{
                    $(".big_pictureurl").css({"height":"90%","width":"auto"});
                    var pich = $(".big_pictureurl").height();
                    var picw = $(".big_pictureurl").width();
                    $(".big_pictureurl").css({"margin-top": -pich/2,"margin-left": -picw/2});
                }
            },500)
            $(document.body).css({"overflow":"hidden","height":wh});
            $("html").css({"overflow":"hidden","height":wh});
            $(".big_pictureclose").click(function(){
                $("body").scrollTop(bodytop);
                $(document.body).css({"overflow":"visible","height":dh});
                $("html").css({"overflow":"visible","height":dh});
                $(".big_picture").hide();
            })
        })

        $(".revise_phonenum").click(function(){   //修改法人手机号
            $(".phone_num").show()
        })
        $(".close").on("click",function(){   //修改法人手机号
            $(".phone_num").hide();
        })
        $("#phoneclose").on("click",function(){   //修改法人手机号
            $(".phone_num").hide();
        })
        $("#phonesure").on("click",function(){   //修改法人手机号
            $("#phonesure").attr({"disabled":"disabled"});
            var oldparentmobile = $(".phone_num input[name='oldparentmobile']").val();
            var newparentmobile = $(".phone_num input[name='newparentmobile']").val();
            $(".phone_num_oldparentmobile").hide();
            $(".phone_num_newparentmobile").hide();
            if(oldparentmobile.length!=11||isNaN(oldparentmobile)){
                $(".phone_num_oldparentmobile").show();
                $("#phonesure").removeAttr("disabled");
            }else if(newparentmobile.length!=11||isNaN(newparentmobile)){
                $(".phone_num_newparentmobile").show();
                $("#phonesure").removeAttr("disabled");
            }else {
                $.ajax({
                    url: '/console/shop/parentmobile/update',
                    data: {
                        cityid: cityid,
                        shopid: shopreviewid,
                        oldparentmobile: oldparentmobile,
                        newparentmobile: newparentmobile,
                        type: 'shop_review'
                    },
                    dataType: 'json',
                    type: 'post',
                    success: function (data) {
                        if (data.status == 'success') {
                            alert(data.message);
                            window.location.href = "/console/shop/review/get?cityid=" + cityid + "&shopreviewid=" + shopreviewid + "&adminrole=" + adminrole + "&now=" + Date.parse(new Date());
                        } else {
                            alert(data.message);
                            $("#phonesure").removeAttr("disabled");
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert(XMLHttpRequest.status);
                        $("#phonesure").removeAttr("disabled");
                    }
                });
            }
        })
        //通过绑定change事件，当下拉框内容发生变化时事件被启动grade
        $("#shop_level_select").bind("change",function(){
            //获取自定义属性的值
            var grade = $(this).find("option:selected").attr("value");
            $("input[name='grade']").val(grade);
        });

        $("#submitshopreview").click(function() {
            var verify_result = $("form select[name='verifyresult']").find("option:selected").val();
            var shoplevel = $("form select[name='shop_level_select']").find("option:selected").val();
            var verify_note = $("textarea[name='verifynote']").val();
            if(verify_result == '') {
                public_prompt();
                $(".public_prompt_name").html("提示");
                $(".public_prompt_ctn").html("请选择审核结果"); return;
            }else if(verify_note == ''){
                public_prompt();
                $(".public_prompt_name").html("提示");
                $(".public_prompt_ctn").html("请输入审核备注"); return;
            }else if(verify_result == 1 && shoplevel == 0){
                public_prompt();
                $(".public_prompt_name").html("提示");
                $(".public_prompt_ctn").html("请选择商家级别"); return;
            }
            if(adminrole == 'businesspeople') {
                if(verify_result == '1') {
                    doublePrompt();
                    $(".double_prompt_content").html("确定要通过？通过以后商家内容到客服人员中审核");
                } else {
                    doublePrompt();
                    $(".double_prompt_content").html("确定要不通过？不通过以后商家内容将会删除");
                }
            } else if(adminrole == 'customer') {
                if(verify_result == '1') {
                    doublePrompt();
                    $(".double_prompt_content").html("确定要通过？通过以后商家内容会上架");
                } else {
                    doublePrompt();
                    $(".double_prompt_content").html("确定要不通过？不通过以后商家内容将到商务人员修改");
                }
            } else {
                public_prompt();
                return;
            }
//            if(isconfirm) {
//                if(adminrole == 'businesspeople') {
//                    var submit_url = '/console/shop/review/businesspeople/submit';
//                    var redirect_url = '/console/shop/waitlist?cityid=' + cityid + '&now=' + new Date().getTime();
//                } else if(adminrole == 'customer'){
//                    var submit_url = '/console/shop/review/customer/submit';
//                    var redirect_url = '/console/shop/custom/waitlist?cityid=' + cityid + '&now=' + new Date().getTime();
//                } else {
//                    var submit_url = '';
//                    var redirect_url = '';
//                }
//                $.ajax({
//                    url : submit_url,
//                    type : 'post',
//                    data: $('form').serialize(),
//                    dataType:'json',
//                    success:function(data){
//                        console.log(data);
//                        window.location.href = redirect_url;
//                    },
//                    error: function(XMLHttpRequest, textStatus, errorThrown) {
//                        alert(XMLHttpRequest.status);
//                        alert(XMLHttpRequest.readyState);
//                        alert(textStatus);
//                    }
//                });
//            }
        });
        $(".double_prompt_sure").on("click",function () {
            $(".double_prompt_sure").attr({"disabled":"disabled"});
            if(adminrole == 'businesspeople') {
                var submit_url = '/console/shop/review/businesspeople/submit';
                var redirect_url = '/console/shop/waitlist?cityid=' + cityid + '&now=' + new Date().getTime();
            } else if(adminrole == 'customer'){
                var submit_url = '/console/shop/review/customer/submit';
                var redirect_url = '/console/shop/custom/waitlist?cityid=' + cityid + '&now=' + new Date().getTime();
            } else {
                var submit_url = '';
                var redirect_url = '';
            }
            $.ajax({
                url : submit_url,
                type : 'post',
                data: $('form').serialize(),
                dataType:'json',
                success:function(data){
                    $(".public_prompt_mark").hide();
                    $(".double_prompt").hide();
                    $(".double_prompt_sure").removeAttr("disabled");
                    console.log(data);
                    window.location.href = redirect_url;
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(XMLHttpRequest.status);
                    alert(XMLHttpRequest.readyState);
                    alert(textStatus);
                }
            });
        });
        function selectverifyresult(id) {
            var parentid = id.value;
//            if(parentid == '2') {
//                alert('提交审核不通过将会删掉商家数据，请慎重选择');
//            }
            if(parentid == '1'){
                $("#shop_level").show();
            }else {
                $("#shop_level").hide();
            }
        }
        //更改维护人
        $(".shop_servicing_check").on("click",function () {
            $(".shop_details_outer_top_check").show();
            $(".shop_details_outer_top").hide();
        })
        $(".shop_servicing_cancel").on("click",function () {
            $(".shop_details_outer_top_check").hide();
            $(".shop_details_outer_top").show();
        })
        $(".shop_servicing_sure").on("click",function () {
            var maintainername = $("#maintainername").find("option:selected").text();
            console.log(maintainername);
        })

        //将所得商务人员的信息赋值roleinfo
        //通过绑定change事件，当下拉框内容发生变化时事件被启动provincename
        $("#roleinfo").bind("change",function(){
            //获取自定义属性的值
            var bianhao = $(this).find("option:selected").attr("value");
            $("input[name='adminroleid']").val(bianhao);
        });

        $("#updatemaintenance").on("click",function(){   //修改维护人姓名和账号
           var maintainerid = $("#adminroleid").val();
            $.ajax({
                url : '/console/shop/maintainer/update',
                data:{
                    cityid:cityid,
                    shopid:shopreviewid,
                    maintainerid:maintainerid,
                    updaterole:'shop_review'
                },
                dataType:'json',
                type:'post',
                success:function(data){
                    if(data.status == 'success') {
                        alert(data.message);
                        window.location.href="/console/shop/review/get?cityid="+cityid+"&shopreviewid="+shopreviewid+"&adminrole="+adminrole+"&now="+Date.parse(new Date());
                    } else {
                        alert(data.message);
                    }
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(XMLHttpRequest.status);
                    alert(XMLHttpRequest.readyState);
                    alert(textStatus);
                }
            });
        })
    </script>
@endsection